package com.weixiaodong.javabasic.Java8提供的函数式编接口.Consumer;

import java.util.function.Consumer;

@SuppressWarnings("all")
public class ConsumerDemo {
    public static void main(String[] args) {
        Consumer c = System.out::println; // c是可以复用的
        c.accept("hello world");
        c.accept("hello java");
        c.accept("hello python");

        c.andThen(c).andThen(c).accept("hello world"); // 输出三次hello world
    }
}
